﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Serialization;

namespace GC_FFW.BusinessEntities.Forecast.Xml
{
	public class Proposal
	{
		[XmlAttribute("order")]
		public int Order { get; set; }

		[XmlAttribute("keywords")]
		public string Keywords { get; set; }

		public IEnumerable<string> KeywordList
		{
			get
			{
				var result = new List<string>();

				if (!string.IsNullOrWhiteSpace(Keywords))
					result.AddRange(Keywords.Split(new[] {Common.Constants.Text.Symbols.SEMICOLON}, StringSplitOptions.RemoveEmptyEntries).Select(k => k.Trim()).ToList());

				return result;
			}
		}

		[XmlAttribute("text")]
		public string Text { get; set; }
	}
}
